#include "Goblin.h"
#include <iostream>
#include <string>
using namespace std;


Goblin::Goblin(string monsterType, int monsterHealth, int xLoc, int yLoc){
	type = monsterType;
	health=monsterHealth;
	maxHealth=monsterHealth;
	level =4;
	attack = 3;
	alive = true;
	xLocation = xLoc;
	yLocation = yLoc;


	}

int Goblin::getXLocation(){
	return xLocation;
	}

int Goblin::getYLocation(){
	return yLocation;
	}

int Goblin::getCurrentHealth(){
	return health;
	}

int Goblin::getAttack(){
	return attack;
	}

int Goblin::getlevel(){
	return level;
	}

string Goblin::getType(){
	return type;
	}

void Goblin::takeDamage(int dmg){
	health -= dmg;
	int dice = rand();
	if ((dice%10)>5)
		rengerate();
	if (health <=0)
		alive = false;
	}

void Goblin::rengerate(){
	health +=2;
	cout<<"Goblin regenerating!"<<endl;
	}

bool Goblin::isAlive(){
	return alive;
	}
